Class Album.TrackListItem

  • Enclosing class:
    Album

    private static class Album.TrackListItem
    extends java.lang.Object
    A single item of a linked list of tracks.
    A single list item consists of the primary data, in our case a track, and a reference to its successor, which is another list item.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) Album.TrackListItem next
      A reference to the next item in the list.
      (package private) Track track
      The primary data of this list item.
    • Constructor Summary

      Constructors 
      Constructor Description
      TrackListItem​(Track t)
      Creates a list item from a track.
      Simply wraps a list item around a track, so it can be inserted into a linked list of tracks.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • track

        Track track
        The primary data of this list item.
    • Constructor Detail

      • TrackListItem

        public TrackListItem​(Track t)
        Creates a list item from a track.
        Simply wraps a list item around a track, so it can be inserted into a linked list of tracks.

        This list item does NOT maintain its own copy of the original track. It means a track in the list can be modified from the caller who might still maintain a reference, however, the list structure is protected.

        Parameters:
        t - the track of this list item